package cn;

import com.fz.dao.BookDAO;
import com.fz.entity.Book;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.util.Date;

/**
 * Created by webrx on 2017-09-12.
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration({"classpath:applicationContext.xml"})
public class BookDemo {
    @Autowired
    protected BookDAO dao;

    @Test
    public void tt(){
        //dao.save("《MySQL数据库技术》",80,"2017-5-6");
        Book b = new Book();
        b.setName("《html5.0》");
        b.setPrice(80);
        b.setBdate(new Date());
        dao.add(b);
    }
}
